<template>
  <div id="entrance_list">
    <div id="search_box">
      <el-card shadow="hover">
        <el-row>
          <el-col :span="8">
            <span class="search-title">搜索：</span>
            <el-input placeholder="请输入内容" v-model="search_input" class="input-with-select" style="width: 360px;">
              <el-select v-model="search_select" slot="prepend" placeholder="请选择" style="width: 110px;">
                <el-option label="身份证号" value="1"></el-option>
                <el-option label="姓名" value="2"></el-option>
              </el-select>
              <el-button slot="append" icon="el-icon-search" @click="search_now"></el-button>
            </el-input>
          </el-col>
          <el-col :span="6">
            <span class="search-title">状态：</span>
            <el-select v-model="page_params.isAdopt" placeholder="请选择" @change="changeStatus">
              <el-option label="全部" value=""></el-option>
              <el-option label="未审批" value="0"></el-option>
              <el-option label="通过" value="1"></el-option>
              <el-option label="未通过" value="2"></el-option>
            </el-select>
          </el-col>
          <el-col :span="6">
            <div v-if="page_params.isAdopt == 0 && page_params.isAdopt != ''">
              <span class="search-title">审批操作：</span>
              <el-button type="success" plain round @click="pass" style="margin: 0 10px">通过</el-button>
              <el-button type="danger" plain round @click="noPass">未通过</el-button>
            </div>
          </el-col>
          <el-col :span="4">
            <el-button type="danger" icon="el-icon-download" @click="download">导出</el-button>
            <el-button type="warning" icon="el-icon-delete" @click="clear">清空</el-button>
          </el-col>
        </el-row>
      </el-card>
    </div>
    <div id="table_box">
      <el-table
        ref="multipleTable"
        :data="tableData"
        border
        stripe
        :height="tableHeight"
        style="width: 100%"
        @selection-change="handleSelectionChange">
        <el-table-column
          type="selection"
          width="50"
          align="center"
        >
        </el-table-column>
        <el-table-column
          label="序号"
          width="50"
          type="index"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="childName"
          label="姓名"
          width="200"
        >
        </el-table-column>
        <el-table-column
          prop="iDNumber"
          label="身份证号"
          width="170">
        </el-table-column>
        <el-table-column
          prop="community"
          label="所在社区">
        </el-table-column>
        <el-table-column
          prop="sex"
          label="性别"
          width="50">
        </el-table-column>
        <el-table-column
          prop="ethnicity"
          label="族别"
          width="120">
        </el-table-column>
        <el-table-column
          prop="contactNumber"
          label="联系手机号"
          width="120">
        </el-table-column>
        <el-table-column
          prop="registeredResidenceNature"
          label="户口性质"
          width="100">
        </el-table-column>
        <el-table-column
          prop="addressOfRegisteredResidence"
          label="户籍所在地">
        </el-table-column>
        <el-table-column
          prop="currentResidentialArea"
          label="现住址小区">
        </el-table-column>
        <el-table-column
          prop="receivedPreschoolEducation"
          label="受过学前教育">
        </el-table-column>
        <el-table-column
          prop="preschoolGraduationKindergarten"
          label="学前毕业幼儿园">
        </el-table-column>
        <el-table-column
          prop="localOrCross"
          label="属于本地或跨学区">
        </el-table-column>
        <el-table-column
          prop="learnUyghur"
          label="学不学维语">
        </el-table-column>
        <el-table-column
          label="状态">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.isAdopt == 0">未审核</el-tag>
            <el-tag type="success" v-if="scope.row.isAdopt == 1">通过</el-tag>
            <el-tag type="danger" v-if="scope.row.isAdopt == 2">未通过</el-tag>
          </template>
        </el-table-column>
        <el-table-column
          prop="commitWord"
          label="不通过原因"
          width="120"
          v-if="page_params.isAdopt == 2 || page_params.isAdopt == ''">
        </el-table-column>
        <el-table-column
          label="详情"
          align="center"
          width="160">
          <template slot-scope="scope">
            <el-button
              type="primary"
              size="mini"
              @click="open(scope.row)">详情
            </el-button>
            <el-button
              type="danger"
              size="mini"
              @click="noPassOne(1,scope.row)" v-if="page_params.isAdopt == 1">变更
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div id="page_box">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="page_params.pageNum"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="page_params.pageSize"
        layout="total, sizes, prev, pager, next"
        :total="page_params.pageCount">
      </el-pagination>
    </div>
    <el-dialog
      title="报名表"
      :visible.sync="dialogVisible"
      top="2vh"
      width="80%">
      <div id="dialog_box">
        <el-row>
          <el-col :span="24" style="text-align: center;">
            <div class="border-no-bottom">学生信息</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">姓名</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.childName }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">性别</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.sex }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">族别</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.ethnicity }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">所在社区</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.community }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">身份证号</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.iDNumber }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">联系手机号</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.contactNumber }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">属于本地或跨学区</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.localOrCross }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">学不学维语</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.learnUyghur }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">现住址所在社区</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.communityOfCurrentAddress }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">现住址小区</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.currentResidentialArea }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">现住详细地址</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.currentAddress }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">户口性质</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.registeredResidenceNature }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户号</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.accountNumber }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">籍贯</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.nativePlace }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户籍所在地址</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.addressOfRegisteredResidence }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">是否随迁子女</div>
          </el-col>
          <el-col :span="2">
            <div class="border-no-bottom-left">{{ openInfo.moveChildren }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">是否进城务工人员随迁子女</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.workersChildren }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">是否孤儿</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.orphan }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">是否受过学前教育</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.receivedPreschoolEducation }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">学前教育年限</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.educationYear }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">学前毕业幼儿园名称</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.preschoolGraduationKindergarten }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">是否家庭经济困难</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.difficultiesFamily }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">低保证号</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.lowGuaranteeNumber }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">是否需要申请资助</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.applyFinancialAssistance }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">是否烈士或优抚子女</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.martyrsChildren }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">上下学距离</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.schoolDistance }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">上下学方式</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.schoolMode }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">户主姓名</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householderName }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主政治面貌</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householdPoliticalOutlook }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主民族</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householdNation }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主身份证号</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householderIDNumber }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="3">
            <div class="border-no-bottom">户主关系</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householderRelationship }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主单位</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householdUnit }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主职业</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householderOccupation }}&nbsp;</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">户主联系电话</div>
          </el-col>
          <el-col :span="3">
            <div class="border-no-bottom-left">{{ openInfo.householderContactNumber }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24" style="text-align: center;">
            <div class="border-no-bottom">监护人信息1</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">姓名</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.fullNameOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">政治面貌</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.politicalOutlookOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">民族</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.nationOne }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">健康状况</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.healthOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">身份证号</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.iDNumberOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">与孩子关系</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.childrenRelationshipOne }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">单位（或住址）</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.unitAddressOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">职务</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.postOne }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">联系电话</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.contactNumberOne }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24" style="text-align: center;">
            <div class="border-no-bottom">监护人信息2</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">姓名</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.fullNameTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">政治面貌</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.politicalOutlookTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">民族</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.nationTwo }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">健康状况</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.healthTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">身份证号</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.iDNumberTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">与孩子关系</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.childrenRelationshipTwo }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="border-no-bottom">单位（或住址）</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.unitAddressTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">职务</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.postTwo }}&nbsp;</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">联系电话</div>
          </el-col>
          <el-col :span="4">
            <div class="border-no-bottom-left">{{ openInfo.contactNumberTwo }}&nbsp;</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24" style="text-align: center;">
            <div class="border-no-bottom">图片资料</div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">父母及子女户口本扫描件</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.householdRegistrationScanning != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.householdRegistrationScanning" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">父母身份证扫描件</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.parentsIDCardScanning != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.parentsIDCardScanning" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">儿童计划免疫接种证扫描件</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.childrenImmunizationCertificateScanning != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.childrenImmunizationCertificateScanning" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">房产证或购房合同扫描件</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.realEstateCertificateScanning != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.realEstateCertificateScanning" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">儿童体检单</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.childrenPhysicalExamination != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.childrenPhysicalExamination" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">残疾证扫描件</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.disabilityCertificateScanning != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.disabilityCertificateScanning" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">社保缴纳一年以上票据证明或纳税证明</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.socialSecurityPaymentProve != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.socialSecurityPaymentProve" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border-no-bottom">所在社区出具暂住证或居住证明</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-bottom-left" v-loading="loading">
              <div v-if="openInfo.residenceCertificate != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.residenceCertificate" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="4">
            <div class="img-border">幼儿园毕业证</div>
          </el-col>
          <el-col :span="20">
            <div class="img-border-no-left" v-loading="loading">
              <div v-if="openInfo.kindergartenDiploma != ''">
                <el-row>
                  <el-col v-for="item1 in openInfo.kindergartenDiploma" :span="8">
                    <el-image :src="img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id"
                              :preview-src-list="[img_url + item1 + '&token=' + img_code + '&id=' + openInfo.id]"
                              style="height: 100px; width: auto;"></el-image>
                  </el-col>
                </el-row>
              </div>
              <div v-else>
                无图片
              </div>
            </div>
          </el-col>
        </el-row>
        <div style="text-align: center; margin: 20px;" v-if="openInfo.isAdopt == 0">
          <el-button type="success" plain round @click="passOne" style="margin-right: 20px;">通过</el-button>
          <el-button type="danger" plain round @click="noPassOne(2)" style="margin-right: 20px;">未通过</el-button>
          <el-button round @click="dialogVisible = false">取消</el-button>
        </div>
        <div style="text-align: center; margin: 20px;" v-if="openInfo.isAdopt != 0">
          <el-button type="success" plain round @click="passOne" style="margin-right: 20px;">修改为通过</el-button>
          <el-button type="danger" plain round @click="noPassOne(2)" style="margin-right: 20px;">修改为未通过</el-button>
          <el-button round @click="dialogVisible = false">取消</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {selectform, approveform, getPicToken, delForm} from '@/api/entrance'

export default {
  data() {
    return {
      tableHeight: document.body.clientHeight - 235,
      search_input: '',
      search_select: '2',
      page_params: {
        pageNum: 1,
        pageCount: 100,
        pageSize: 20,
        IDNumber: '',
        childName: '',
        isAdopt: '0'
      },
      tableData: [],
      multipleSelection: [],
      dialogVisible: false,
      openInfo: {},
      img_info: {},
      loading: false,
      img_url: process.env.VUE_APP_BASE_API + '/entrymodel/getPicByToken?fileId=',
      img_code: '',
    };
  },
  methods: {
    handleSizeChange(val) {
      this.page_params.pageNum = 1;
      this.page_params.pageSize = val;
      this.refresh_data();
    },
    handleCurrentChange(val) {
      this.page_params.pageNum = val;
      this.refresh_data();
    },
    refresh_data() {
      selectform(this.page_params).then((res) => {
        if (res.code != "200") {
          this.$message({
            message: res.msg,
            type: 'warning'
          });
        } else {
          this.tableData = res.data.object;
          this.page_params.pageCount = res.data.pageCount;
        }
      }).catch(() => {

      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    open(row) {
      this.loading = true;
      getPicToken({id: row.id}).then((res) => {
        if (res.code != "200") {
          this.$message({
            message: res.msg,
            type: 'warning'
          });
        } else {
          // this.$message({message: '打开dialog'})
          this.img_code = res.data;
          let data = JSON.parse(JSON.stringify(row));
          data.householdRegistrationScanning = data.householdRegistrationScanning.split(';').map(it => encodeURIComponent(it));
          data.parentsIDCardScanning = data.parentsIDCardScanning.split(';').map(it => encodeURIComponent(it));
          data.childrenImmunizationCertificateScanning = data.childrenImmunizationCertificateScanning.split(';').map(it => encodeURIComponent(it));
          data.realEstateCertificateScanning = data.realEstateCertificateScanning.split(';').map(it => encodeURIComponent(it));
          // data.childrenPhysicalExamination = data.childrenPhysicalExamination.split(';');
          data.disabilityCertificateScanning = data.disabilityCertificateScanning.split(';').map(it => encodeURIComponent(it));
          data.socialSecurityPaymentProve = data.socialSecurityPaymentProve.split(';').map(it => encodeURIComponent(it));
          data.residenceCertificate = data.residenceCertificate.split(';').map(it => encodeURIComponent(it));
          data.kindergartenDiploma = data.kindergartenDiploma.split(';').map(it => encodeURIComponent(it));
          this.openInfo = data;
          this.dialogVisible = true;
          // this.$message("执行成功")
          this.loading = false;
        }
      }).catch((err) => {
        console.log("err", err)
      })
    },
    search_now() {
      if (this.search_select == 1) {
        this.page_params.childName = '';
        this.page_params.IDNumber = this.search_input;
      } else {
        this.page_params.childName = this.search_input;
        this.page_params.IDNumber = '';
      }
      this.page_params.pageNum = 1;
      this.refresh_data();
    },
    changeStatus() {
      if (this.page_params.isAdopt == '0' || this.page_params.isAdopt == '2') {
        this.tableHeight = document.body.clientHeight - 235;
      } else {
        this.tableHeight = document.body.clientHeight - 240;
      }
      this.page_params.pageNum = 1;
      this.refresh_data();
    },
    passOne() {
      let arr = [];
      arr.push({
        id: this.openInfo.id,
        ethnicity: this.openInfo.ethnicity,
        isAdopt: '1'
      })
      this.send(arr);
    },
    noPassOne(type, row) {
      let title = '';
      if (type == 1) {
        title = '操作会将该记录变更为未通过，请输入变更原因';
      } else {
        title = '请输入未通过原因';
      }
      this.$prompt(title, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(({value}) => {
        let arr = [];
        if (type == 1) {
          arr.push({
            id: row.id,
            ethnicity: row.ethnicity,
            isAdopt: '2',
            commitWord: value
          })
        } else {
          arr.push({
            id: this.openInfo.id,
            ethnicity: this.openInfo.ethnicity,
            isAdopt: '2',
            commitWord: value
          })
        }
        this.send(arr);
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消输入'
        });
      });

    },
    pass() {
      let arr = [];
      for (let i = 0; i < this.multipleSelection.length; i++) {
        arr.push({
          id: this.multipleSelection[i].id,
          ethnicity: this.multipleSelection[i].ethnicity,
          isAdopt: '1'
        })
      }
      this.send(arr);
    },
    noPass() {
      this.$prompt('请输入未通过原因', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(({value}) => {
        let arr = [];
        for (let i = 0; i < this.multipleSelection.length; i++) {
          arr.push({
            id: this.multipleSelection[i].id,
            ethnicity: this.multipleSelection[i].ethnicity,
            isAdopt: '2',
            commitWord: value
          })
        }
        this.send(arr);
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消输入'
        });
      });
    },
    send(arr) {
      approveform(arr).then((res) => {
        if (res.code != "200") {
          this.$message({
            message: res.msg,
            type: 'warning'
          });
        } else {
          this.dialogVisible = false;
          this.refresh_data();
        }
      }).catch(() => {

      })
    },
    download() {
      window.location.href = process.env.VUE_APP_BASE_API + '/entrancemodel/selectItemCountExportExcel?' +
        '&token=' + window.sessionStorage.getItem('token');
    },
    clear() {
      this.$confirm('此操作将永久入学记录, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        delForm({}).then((res) => {
          if (res.code != "200") {
            this.$message({
              message: res.msg,
              type: 'warning'
            });
          } else {
            this.$message({
              message: res.msg,
              type: 'success'
            });
            this.refresh_data();
          }
        }).catch(() => {

        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });

    }
  },
  created() {
    this.refresh_data();
  }
}
</script>
<style lang="scss">
#entrance_list {
  #search_box {
    margin: 10px;

    .search-title {
      font-size: 14px;
      color: #909399;
    }
  }

  #table_box {
    margin: 10px;
  }

  #page_box {
    text-align: center;
    margin-bottom: 10px;
  }

  #dialog_box {
    .border-no-bottom {
      border: 1px solid #E6A23C;
      border-bottom: none;
      padding: 10px;
      min-height: 38px;
    }

    .border-no-bottom-left {
      border-top: 1px solid #E6A23C;
      border-right: 1px solid #E6A23C;
      padding: 10px;
      min-height: 38px;
    }

    .img-border-no-bottom {
      border: 1px solid #E6A23C;
      border-bottom: none;
      padding: 10px;
      min-height: 128px;
    }

    .img-border-no-bottom-left {
      border-top: 1px solid #E6A23C;
      border-right: 1px solid #E6A23C;
      padding: 10px;
      min-height: 128px;
    }

    .img-border {
      border: 1px solid #E6A23C;
      padding: 10px;
      min-height: 128px;
    }

    .img-border-no-left {
      border: 1px solid #E6A23C;
      border-left: none;
      padding: 10px;
      min-height: 128px;
    }
  }
}
</style>
